package com.zust.zst.common.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author gavin
 * @date 2022/11/13 17:24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class LoginDTO {

    @NotNull(message = "工号/学号不能为空")
    @Min(value = 1, message = "uid必须为数字")
    private Integer uid;

    @NotBlank(message = "密码不能为空")
    @Length(max = 20, message = "密码不能超过20位")
    private String password;

    /**
     * 1-管理员; 2-讲师
     */
    @NotNull(message = "身份状态不能为空")
    @Range(message = "身份状态必须为数字，范围{min}到{max}之间", min = 1, max = 3)
    private Integer type;

}
